package seace.services;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import seace.model.Participante;


/**
 * Servlet implementation class Credenciar
 */
public class Credenciar implements Service {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		Integer inscricao = Integer.parseInt(request.getParameter("inscricao"));
		String data = request.getParameter("data");
		String horario = request.getParameter("horario");
		
		Participante participante = new Participante();
		participante.setInscricao(inscricao);
		
		System.out.println("Inscricao:" + participante.getInscricao());
		System.out.println("Data:" + data);
		System.out.println("Horario:" + horario);
		
		RequestDispatcher rd = request.getRequestDispatcher("/credenciamento-ok.jsp");
		rd.forward(request, response);
//		try{
//			ParticipanteDao dao = new ParticipanteDao();
//			dao.credenciar(participante);
//		}catch(SQLException e){
//			throw new ServletException(e);
//		}
		
	}


}
